\(\int \frac {\tan (x)}{a+b \cos (x)} \, dx\) [13]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 11, antiderivative size = 20 \[ \int \frac {\tan (x)}{a+b \cos (x)} \, dx=-\frac {\log (\cos (x))}{a}+\frac {\log (a+b \cos (x))}{a} \]

[Out]

-ln(cos(x))/a+ln(a+b*cos(x))/a

Rubi [A] (verified)

Time = 0.07 (sec) , antiderivative size = 20, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.364, Rules used = {2800, 36, 29, 31} \[ \int \frac {\tan (x)}{a+b \cos (x)} \, dx=\frac {\log (a+b \cos (x))}{a}-\frac {\log (\cos (x))}{a} \]

[In]

Int[Tan[x]/(a + b*Cos[x]),x]

[Out]

-(Log[Cos[x]]/a) + Log[a + b*Cos[x]]/a

Rule 29

Int[(x_)^(-1), x_Symbol] :> Simp[Log[x], x]

Rule 31

Int[((a_) + (b_.)*(x_))^(-1), x_Symbol] :> Simp[Log[RemoveContent[a + b*x, x]]/b, x] /; FreeQ[{a, b}, x]

Rule 36

Int[1/(((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))), x_Symbol] :> Dist[b/(b*c - a*d), Int[1/(a + b*x), x], x] -
Dist[d/(b*c - a*d), Int[1/(c + d*x), x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0]

Rule 2800

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*tan[(e_.) + (f_.)*(x_)]^(p_.), x_Symbol] :> Dist[1/f, Subst[I
nt[(x^p*(a + x)^m)/(b^2 - x^2)^((p + 1)/2), x], x, b*Sin[e + f*x]], x] /; FreeQ[{a, b, e, f, m}, x] && NeQ[a^2
 - b^2, 0] && IntegerQ[(p + 1)/2]

Rubi steps \begin{align*} \text {integral}& = -\text {Subst}\left (\int \frac {1}{x (a+x)} \, dx,x,b \cos (x)\right ) \\ & = -\frac {\text {Subst}\left (\int \frac {1}{x} \, dx,x,b \cos (x)\right )}{a}+\frac {\text {Subst}\left (\int \frac {1}{a+x} \, dx,x,b \cos (x)\right )}{a} \\ & = -\frac {\log (\cos (x))}{a}+\frac {\log (a+b \cos (x))}{a} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.01 (sec) , antiderivative size = 20, normalized size of antiderivative = 1.00 \[ \int \frac {\tan (x)}{a+b \cos (x)} \, dx=-\frac {\log (\cos (x))}{a}+\frac {\log (a+b \cos (x))}{a} \]

[In]

Integrate[Tan[x]/(a + b*Cos[x]),x]

[Out]

-(Log[Cos[x]]/a) + Log[a + b*Cos[x]]/a

Maple [A] (verified)

Time = 0.50 (sec) , antiderivative size = 21, normalized size of antiderivative = 1.05

method result size
default \(-\frac {\ln \left (\cos \left (x \right )\right )}{a}+\frac {\ln \left (a +\cos \left (x \right ) b \right )}{a}\) \(21\)
risch \(-\frac {\ln \left ({\mathrm e}^{2 i x}+1\right )}{a}+\frac {\ln \left ({\mathrm e}^{2 i x}+\frac {2 a \,{\mathrm e}^{i x}}{b}+1\right )}{a}\) \(38\)

[In]

int(tan(x)/(a+cos(x)*b),x,method=_RETURNVERBOSE)

[Out]

-ln(cos(x))/a+ln(a+cos(x)*b)/a

Fricas [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 22, normalized size of antiderivative = 1.10 \[ \int \frac {\tan (x)}{a+b \cos (x)} \, dx=\frac {\log \left (-b \cos \left (x\right ) - a\right ) - \log \left (-\cos \left (x\right )\right )}{a} \]

[In]

integrate(tan(x)/(a+b*cos(x)),x, algorithm="fricas")

[Out]

(log(-b*cos(x) - a) - log(-cos(x)))/a

Sympy [F]

\[ \int \frac {\tan (x)}{a+b \cos (x)} \, dx=\int \frac {\tan {\left (x \right )}}{a + b \cos {\left (x \right )}}\, dx \]

[In]

integrate(tan(x)/(a+b*cos(x)),x)

[Out]

Integral(tan(x)/(a + b*cos(x)), x)

Maxima [A] (verification not implemented)

none

Time = 0.22 (sec) , antiderivative size = 20, normalized size of antiderivative = 1.00 \[ \int \frac {\tan (x)}{a+b \cos (x)} \, dx=\frac {\log \left (b \cos \left (x\right ) + a\right )}{a} - \frac {\log \left (\cos \left (x\right )\right )}{a} \]

[In]

integrate(tan(x)/(a+b*cos(x)),x, algorithm="maxima")

[Out]

log(b*cos(x) + a)/a - log(cos(x))/a

Giac [A] (verification not implemented)

none

Time = 0.31 (sec) , antiderivative size = 22, normalized size of antiderivative = 1.10 \[ \int \frac {\tan (x)}{a+b \cos (x)} \, dx=\frac {\log \left ({\left | b \cos \left (x\right ) + a \right |}\right )}{a} - \frac {\log \left ({\left | \cos \left (x\right ) \right |}\right )}{a} \]

[In]

integrate(tan(x)/(a+b*cos(x)),x, algorithm="giac")

[Out]

log(abs(b*cos(x) + a))/a - log(abs(cos(x)))/a

Mupad [B] (verification not implemented)

Time = 13.92 (sec) , antiderivative size = 48, normalized size of antiderivative = 2.40 \[ \int \frac {\tan (x)}{a+b \cos (x)} \, dx=\frac {\mathrm {atan}\left (\frac {a\,{\sin \left (\frac {x}{2}\right )}^2}{a\,{\cos \left (\frac {x}{2}\right )}^2\,1{}\mathrm {i}+b\,{\cos \left (\frac {x}{2}\right )}^2\,1{}\mathrm {i}-b\,{\sin \left (\frac {x}{2}\right )}^2\,1{}\mathrm {i}}\right )\,2{}\mathrm {i}}{a} \]

[In]

int(tan(x)/(a + b*cos(x)),x)

[Out]

(atan((a*sin(x/2)^2)/(a*cos(x/2)^2*1i + b*cos(x/2)^2*1i - b*sin(x/2)^2*1i))*2i)/a